package banking;

public class Statement implements Comparable<Statement> {
	
	private String reason = "";
	private long value = 0;
	private int accountNumber = 0;
	private long date;

	public void makeStatement(int accountNumber, long value, String reason, long date) {
		this.accountNumber = accountNumber;
		this.value = value;
		this.reason = reason;
		this.date = date;
	}
	
	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public long getValue() {
		return value;
	}

	public void setValue(long value) {
		this.value = value;
	}

	public int getAccountNumber() {
		return accountNumber;
	}

	public void setAccountNumber(int accountNumber) {
		this.accountNumber = accountNumber;
	}

	public void setDate(long date) {
		this.date = date;
	}

	public long getDate() {
		return date;
	}

	@Override
	public String toString() {
		return "Statement [accountNumber=" + accountNumber + ", date=" + date
				+ ", reason=" + reason + ", value=" + value + "]";
	}
	
	@Override
	public int compareTo(Statement o2) {
		if (this.getValue() > o2.getValue()){
			return 1;
		} else if (this.getValue() == o2.getValue()){
			return 0;
		} else {
			return -1;
		}
	}

	//@Override
	public int compareToStr(Statement o2) {
		if (this.getReason().compareTo(o2.getReason()) > 0){
			return 1;
		} else if (this.getReason().equals(o2.getReason())){
			return 0;
		} else {
			return -1;
		}
	}
	
}
